Skip to content

feat(ecs): Add ODCR support for capacity provider managed instances#47471

Open
dloeafoe wants to merge 2 commits intohashicorp:mainfrom
dloeafoe:f-aws_ecs_capacity_provider-odcr-support
Open

feat(ecs): Add ODCR support for capacity provider managed instances#47471
dloeafoe wants to merge 2 commits intohashicorp:mainfrom
dloeafoe:f-aws_ecs_capacity_provider-odcr-support

Conversation

@dloeafoe
Copy link
Copy Markdown

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

This PR adds On-Demand Capacity Reservation (ODCR) support to the aws_ecs_capacity_provider resource for Managed Instances capacity providers. With this change, users can reserve EC2 compute capacity in a specific Availability Zone, guaranteeing that instances are available when ECS needs to scale their workloads. Users can now specify a capacity_option_type of RESERVED within the instance_launch_template block to enable capacity reservation integration, alongside the existing ON_DEMAND and SPOT options. A new capacity_reservations block allows users to target a specific Capacity Reservation resource group via reservation_group_arn and control reservation behavior through reservation_preference, which supports RESERVATIONS_ONLY for exclusive use of reserved capacity, RESERVATIONS_FIRST for preferring reservations with on-demand fallback and RESERVATIONS_EXCLUDED for avoiding reservations entirely.

Relations

Closes #0000

References

Output from Acceptance Testing

--- PASS: TestAccECSCapacityProvider_capacityReservations_validationErrors (7.85s)
--- PASS: TestAccECSCapacityProvider_capacityReservations_groupArnOnly (49.86s)
--- PASS: TestAccECSCapacityProvider_capacityOptionType_onDemandExplicit (49.95s)
--- PASS: TestAccECSCapacityProvider_capacityOptionType_immutable (53.97s)
--- PASS: TestAccECSCapacityProvider_createManagedInstancesProvider_withCapacityReservations (55.01s)
--- PASS: TestAccECSCapacityProvider_createManagedInstancesProvider_basic (55.34s)
--- PASS: TestAccECSCapacityProvider_capacityReservations_additionalValidationErrors (6.84s)
--- PASS: TestAccECSCapacityProvider_updateManagedInstancesProvider_capacityReservations (78.97s)
--- PASS: TestAccECSCapacityProvider_createManagedInstancesProvider_withInfrastructureOptimization (90.00s)
--- PASS: TestAccECSCapacityProvider_createManagedInstancesProvider_withStorageConfiguration (44.12s)
--- PASS: TestAccECSCapacityProvider_createManagedInstancesProvider_withInstanceRequirements (45.06s)
--- PASS: TestAccECSCapacityProvider_updateManagedInstancesProvider (60.97s)
--- PASS: TestAccECSCapacityProvider_capacityReservations_excludedPreference (36.51s)

@dloeafoe dloeafoe requested a review from a team as a code owner April 15, 2026 19:09
@dosubot dosubot Bot added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2026

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions Bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ecs Issues and PRs that pertain to the ecs service. size/XL Managed by automation to categorize the size of a PR. labels Apr 15, 2026
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants